# 识别有效的IP地址和掩码，并且进行分类统计

def PanDuanIP(STR, LIST1):
    LIST = list(STR.split("."))
    A = B = 0
    for i in LIST:
        if i == '':
            LIST1[5] += 1
            return LIST1
    if 1 <= int(LIST[0]) <= 126:
        LIST1[0] += 1
        if int(LIST[0]) == 10:
            LIST1[6] += 1
    elif 128 <= int(LIST[0]) <= 191:
        LIST1[1] += 1
        if int(LIST[0]) == 172 and 16 <= int(LIST[1]) <= 31:
            LIST1[6] += 1
    elif 192 <= int(LIST[0]) <= 223:
        LIST1[2] += 1
        if int(LIST[0]) == 192 and int(LIST[1]) == 168:
            LIST1[6] += 1
    elif 224 <= int(LIST[0]) <= 239:
        LIST1[3] += 1
    elif 240 <= int(LIST[0]) <= 255:
        LIST1[4] += 1 
    else:
        return LIST1
    return LIST1
    
def PanDuanMask(STR):
    LIST = list(STR.split("."))
    STRMASK = ''
    for i in LIST:
        if i != '':
            # 一定要写一个正确的表达内容，不然容易出现判断错误
            STRMASK = STRMASK + '{:08b}'.format(int(i))
    for i in range(0, len(STRMASK)):
        if STRMASK[i] == '0':
            # 如果有全 1 的掩码，则会出现没有返回值，需要在循环外面设置一个返回值,且全1和全0 是非法
            if '1' not in STRMASK[i:] and i != 0 and i != 32:
                return i
            else:
                return 99
    return 99

resultL = [0, 0, 0, 0, 0, 0, 0]
while True:
    try:
        InputStrList = list(input().split("~"))
        if InputStrList[0].split(".")[0] == '0' or InputStrList[0].split(".")[0] == '127':
            continue
        else:
            if PanDuanMask(InputStrList[1]) < 99 :
                resultL = PanDuanIP(InputStrList[0], resultL)
            else:
                resultL[5] += 1
    except:
        break

for i in resultL:
    print(i, end=' ')